const path = require('path');
let RunPlugin = require('./plugins/run-plugin');
let DonePlugin = require('./plugins/done-plugin');
let EmitPlugin = require('./plugins/emit-plugin');
module.exports = {
    mode:'development',
    devtool:false,
    context:process.cwd(),
    entry:{
        entry1:'./src/entry1.js',
        entry2:'./src/entry2.js',
    },
    output:{
        path:path.resolve(__dirname,'build'),
        filename:'[name].js'
    },
    resolve:{
        extensions:['.js','.jsx','.json']
    },
    module:{
        rules:[
            {
                test:/\.js$/,
                use:[
                    //'logger3-loader.js',//node_modules里找
                    path.resolve(__dirname,'loaders','logger1-loader.js'),//自定义loader绝对路径
                    path.resolve(__dirname,'loaders','logger2-loader.js'),
                ]
            }
        ]
    },
    plugins:[
        new RunPlugin(),
        new DonePlugin(),
        new EmitPlugin()
    ]
}